import { request } from "vendor/utils/T";
import { toApi } from "@/service/proxyApi";
import {RespDataType,RequestDataType} from "./apiType";
export * from "./apiType";

const {get, del, postJSON, put} = request;

/**
 * 获取岗位分页列表
 */
export const getPostPageList = (params: {page:number, pageSize:number, postCode?: string, postName?: string, status?: string}) => {
    return get<PageList<RespDataType.PostItem>>(toApi("system/post/list"), params);
}

/**
 * 新增岗位数据
 */
export const createPost = (params: RequestDataType.CreatePostItem) => {
    return postJSON(toApi("system/post"), params);
}

/**
 * 获取岗位信息
 */
export const getPostInfo = (postId: number) => {
    return get<RequestDataType.CreatePostItem>(toApi("system/post"), {postId});
}

/**
 * 更新岗位信息
 */
export const updatePostInfo = (params: RequestDataType.CreatePostItem) => {
    return put(toApi("system/post"), params);
}

/**
 * 删除岗位信息
 */
export const deletePostInfo = (postIdList:number[]) => {
    return del(toApi("system/post"), postIdList);
}